﻿<!--#include FILE="Admin_Include.asp"-->
<!--#include FILE="Admin_UploadClass.asp"-->
<%
Response.Write "<!DOCTYPE html>" & vbCrLf
Response.Write "<head>" & vbCrLf
Response.Write "<title>文件上传报告</title>" & vbCrlf
Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
Response.Write "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>" & vbCrLf
Response.Write "<meta name='apple-mobile-web-app-status-bar-style' content='black'>" & vbCrLf
Response.Write "<meta name='apple-mobile-web-app-capable' content='yes'>" & vbCrLf
Response.Write "<meta name='format-detection' content='telephone=no'>" & vbCrLf
Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""../fonts/font-awesome/css/font-awesome.min.css"" />" & vbCrLf
Response.Write "<link href='../Plugins/layui/css/layui.css' rel='stylesheet' type='text/css' />" & vbCrLf
Response.Write "<link rel=""stylesheet"" href=""../Style/global.css"" media=""all"">" & vbCrLf
Response.Write "<link rel=""stylesheet"" href=""../Style/font.css"" media=""all"">" & vbCrLf
Response.Write "<script type='text/javascript'>" & vbCrLf
Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
Response.Write "</script>" & vbCrLf
Response.Write "<script type='text/javascript' src='../Js/Admin.js'></script>" & vbCrLf
Response.Write "<script type='text/javascript' src='../../Dialog/main.js'></script>" & vbCrLf
Response.Write "<script type='text/javascript' src='../../Dialog/lhgcore.min.js'></script>" & vbCrLf
Response.Write "<script type='text/javascript' src='../../Dialog/lhgcalendar.min.js'></script>" & vbCrLf
Response.Write "</head>" & vbCrlf
Response.Write "<body>" & vbCrlf

dim upload,file,formName,formPath,iCount,act,iFail
set upload=new upload_5xSoft

response.write ""&upload.Version&""

if upload.form("filepath")="" Then
	HtmEnd "请输入要上传至的目录!",1,""
	set upload=nothing
	Response.End()
else
	formPath=upload.form("filepath")
	''在目录后加(/)
	if right(formPath,1)<>"/" Then formPath=formPath&"/"
	act=procCheckDir(formpath,1)
	if act<>"ok" Then htmEnd "错误! "&act,1,""
end if

iCount=0
iFail=0
for each formName in upload.file
	set file=upload.file(formName)
	if file.FileSize>0 Then
		act=procCheckFile(file.FileName,0)
		response.write "<table class=""layui-table magt0""><tr class='title'><td align='center'>"&file.FilePath&file.FileName&",大小:"&file.FileSize&" => "&formPath&File.FileName&"</td></tr>"
		if act="ok" Then
			file.SaveAs Server.mappath(formPath&file.FileName)
			response.write "<tr><td align='center'>成功!</td></tr></table><br>"
			iCount=iCount+1
		else
			response.write "<tr><td align='center'>失败! "&act&"</td></tr></table><br>"
			iFail=iFail+1
		end if
	end if
	set file=nothing
next
set upload=nothing  ''删除此对象
response.write "<table class=""layui-table magt0""><tr class='title'><td align='center'>"&iCount&"个文件上传成功! "&iFail&"个文件上传失败</td></tr>"
Response.Write "<tr class='tdbg'>" & vbCrlf
Response.Write "<td align='center'><button type=""button"" class=""layui-btn"" hidefocus=""true"" accesskey=""c"" onClick=""ownerDialog.close();topWin.parent.main.location.reload();"">关闭[C]</button></td>" & vbCrlf
Response.Write "</tr>" & vbCrlf
Response.Write "</table>" & vbCrlf
Response.Write "</body>" & vbCrlf
Response.Write "</html>"
%>